package com.ljx.recruitment.interview.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-11-02  10:27
 */
@Getter
@AllArgsConstructor
public enum JobKindEnum {


    FULL_TIME(1, "全职"),
    INTERNSHIP(2, "实习");

    private Integer key;
    private String desc;
    private static Map<Integer, JobKindEnum> cache;

    static {
        cache = Arrays.stream(JobKindEnum.values()).collect(Collectors.toMap(JobKindEnum::getKey, Function.identity()));
    }

    public static JobKindEnum getByKey(Integer key){
        return cache.get(key);
    }
}
